<script setup lang="ts">
import {userType} from "../models/user";
import {defineProps} from "vue";

// 定义一个类型
interface UserCardListProps{
  userList: userType[];
}

// 获取父组件传来的数据
const props = defineProps<UserCardListProps>();
</script>

<template>
    <van-card v-for="user in props.userList" tag="vip" :desc="user.profile" :title="user.username"
              :thumb="user.avatarUrl">
      <template #tags>
        <van-tag plain style="margin: 4px 4px 0 0" type="primary" v-for="tag in user.tags" :key="tag">
          {{ tag }}
        </van-tag>
      </template>
      <template #footer>
        <van-button size="mini">联系我</van-button>
      </template>
    </van-card>

</template>

<style scoped>

</style>